﻿using Newtonsoft.Json;
/*var json ="{"EHS-2-48CD":   { "Device Fault": 
    [

    {"fault": 180,"state":56,"msk":0,"name": "DER_OPERATE_AIR","time": "2000-01-01 08:58:39","mS":750},
	{"fault":208,"state":101,"msk":0,"name": "DER_PLC_1","time": "2000-01-01 08:58:33","mS":750}
]}
}";
*/


var test = "ddd[DDDD]yyyyy";
 var tttt = test.IndexOf('[');
var tttts = test.IndexOf(']');
var scb = test.Substring(tttt, test.Length -tttts);

List<jsonTest>  list = new List<jsonTest>() { new jsonTest() { id =1,name ="333"}, new jsonTest() { id = 2, name = "2222" } };

var t = JsonConvert.SerializeObject(list);
var tt = JsonConvert.DeserializeObject<List<jsonTest>>(t);
Console.WriteLine(t);


class TT
{
    Action tt;
}

class jsonTest
{
    public int  id { get; set; }

    public string name { get; set; }
}